home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / skey_mips.pro < prev    next >
Text File  |  1997-07-08  |  3KB  |  97 lines

  1. ; $Id: skey_mips.pro,v 1.4 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1990-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. pro skey_mips,app_keypad=app_keypad,num_keypad=num_keypad
  7. ;+
  8. ; NAME:
  9. ;    SKEY_MIPS
  10. ;
  11. ; PURPOSE:
  12. ;    Under Unix, the number of function keys, their names, and the
  13. ;    escape sequences they send to the host computer vary
  14. ;    enough between various keyboards that IDL cannot be
  15. ;    written to understand all keyboards. Therefore, it provides
  16. ;    a very general routine named DEFINE_KEY that allows the
  17. ;    user to specify the names and escape sequences. This
  18. ;    routine uses DEFINE_KEY to enter the keys for the MIPS RS
  19. ;    series keyboard.
  20. ;
  21. ;    Note: SKEY_MIPS is primarily designed to be called by
  22. ;    SETUP_KEYS, which attempts to automatically detect the correct
  23. ;    keyboard type in use, and define the keys accordingly.
  24. ;    Nonetheless, SKEY_MIPS can be called as a standalone
  25. ;    routine.
  26. ;
  27. ; CATEGORY:
  28. ;    Misc.
  29. ;
  30. ; CALLING SEQUENCE:
  31. ;    SKEY_MIPS
  32. ;
  33. ; INPUTS:
  34. ;    None.
  35. ;
  36. ; KEYWORD PARAMETERS:
  37. ;  APP_KEYPAD:    Defines escape sequences for the group of keys
  38. ;        in the numeric keypad, enabling these keys to be programmed
  39. ;        within IDL.
  40. ;
  41. ;  NUM_KEYPAD:    Disables programmability of the numeric keypad.
  42. ;
  43. ; OUTPUTS:
  44. ;    None.
  45. ;
  46. ; COMMON BLOCKS:
  47. ;    None.
  48. ;
  49. ; SIDE EFFECTS:
  50. ;    The definitions for the function keys have been entered, and
  51. ;    can be viewed using HELP,/KEYS .
  52. ;
  53. ;    The <Print Scrn>, <Scroll Lock>, and <Pause> keys are not defined,
  54. ;    as they do not generate standard escape sequences.  The same is
  55. ;    true for <Home>, <Delete>, and <End> in the grouping of six keys above
  56. ;    the arrow keys; however, the other three in the group ARE defined.
  57. ;    Keys defined to have labels beginning with a capital "K" belong
  58. ;    to the numeric keypad group.  For example, "K9" refers to keypad
  59. ;    key "9".  The <Num Lock> key is the only one within the keypad
  60. ;    which is not defined.
  61. ;
  62. ; MODIFICATION HISTORY:
  63. ;    TJA , July 1990.  SETUP_KEYS_MIPS created, and call to SETUP_KEYS_MIPS
  64. ;              placed in procedure SETUP_KEYS.
  65. ;    AB, 21 September 1992,renamed from SETUP_KEYS_MIPS to SKEY_MIPS to
  66. ;        avoid DOS filename limitations.
  67. ;    AB, 16 June 1993, The IDL scanner used to treat octal string escapes
  68. ;        in a manner similar to the C language, but this ability was
  69. ;        removed to make the MS DOS port possible (conflicts with
  70. ;        file path specifications). Removed all uses of that here.
  71. ;-
  72. if (keyword_set(app_keypad)) then print,string(byte([27,61])) ; Enable keypad
  73. if (keyword_set(num_keypad)) then print,string(byte([27,62])) ; Disable keypad
  74. esc = string(27B)
  75. newl = string(13B)
  76. ; Top row of function keys
  77. fvals=[11,12,13,14,15,17,18,19,20,21,23,24]
  78. for i=1,12 do define_key,'F'+strtrim(string(i),2), $
  79.               escape=esc+'['+string(fvals[i-1],'(i2)')+'~'
  80. ; Labelled keys above the arrow keys (HOME, DELETE, and END are not definable)
  81. define_key,'INSERT',escape=esc+'[2~'
  82. define_key,'PAGE_UP',escape=esc+'[5~'
  83. define_key,'PAGE_DOWN',escape=esc+'[6~'
  84. ; Numeric keypad - This only works if application keypad is enabled!
  85. define_key,'K/',escape=esc+'Oo'
  86. define_key,'K*',escape=esc+'Oj'
  87. define_key,'K-',escape=esc+'Om'
  88. define_key,'K+',escape=esc+'Ok'
  89. define_key,'K_ENTER',escape=esc+'OM'
  90. nkeys='0123456789'
  91. nvals='pqrstuvwxy'
  92. for i=0,9 do define_key,'K'+strmid(nkeys,i,1), $
  93.              escape=esc+'O'+strmid(nvals,i,1)
  94. define_key,'K.',escape=esc+'On'
  95. return ; MIPS RS keyboard
  96. end
  97.